import cv2
import pickle
import numpy as np

# 读取图片
image_data = cv2.imread("../data/test/74.jpg", 0)
image_data = image_data.reshape(784)
image_data = [1 if i > 126 else 0 for i in image_data]

# 加载模型
with open('图片分类模型.pickle', 'rb') as f:
    model = pickle.load(f)  # 将训练好的模型clf存储在变量f中，且保存到本地

print(model.predict([image_data])[0])
